<?php
// +----------------------------------------------------------------------
// | Tplay [ WE ONLY DO WHAT IS NECESSARY ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017 http://tplay.pengyichen.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 听雨 < 389625819@qq.com >
// +----------------------------------------------------------------------


namespace app\admin\controller;

use app\admin\controller\User;
use \think\Db;
use \think\Cookie;
use app\admin\model\Coupondetails as Cpdt;
class Coupondetails extends User
{


    /**
     * 列表首页
     */
    public function index()
    {
        $model=new  Cpdt();

        $date=$model->paginate(20);
//        $date['day']='';
//        foreach ($date as $key=>$val){
////                foreach ($val['Coupon'] as $v){
////                    dump($v['end_usetime']);
////                }
//            $date['day']='';
//
//            $day=$val['Coupon']['end_usetime']-$val['Coupon']['etart_usetime'];
//
//            $time=date('d',$day).'天'.date('H',$day).'小时';
//            $date['day']=$time;
//        }

     //   $day=$val['end_usetime']-$val['Coupon']['etart_usetime'];

    $this->assign('lie',$date);
        return $this->fetch();
    }


}
